package demo.designPattern.aop.aspectJ.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class UserDaoAspect {

    // 定义切入点，指明要匹配的接口和方法
    @Pointcut("execution(Boolean demo.spring.service.IUserDAO.findUserById(..))")
    public void findUserByIdPointcut() {
    }

    // 定义在切入点前执行的通知
    @Before("findUserByIdPointcut()")
    public void beforeFindUserByIdPointcut() {
        System.out.println("UserDaoAspect: beforeFindUserByIdPointcut");
    }
}
